#ifndef HPLCPUMPBASICCONTROLPAGE_H
#define HPLCPUMPBASICCONTROLPAGE_H

#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout>

class HplcPumpBasicControlPage : public QWidget
{
    Q_OBJECT
public:
    explicit HplcPumpBasicControlPage(QWidget *parent = nullptr);
    virtual ~HplcPumpBasicControlPage() override;

protected:
    virtual void closeEvent(QCloseEvent *event) override;

public slots:
    void onParseCompleted(int id, const QVariant &var);

private:
    // 流速
    QLabel *m_lbFlow;
    QLineEdit *m_leFlow;
    QPushButton	*m_pbSetFlow;
    QPushButton	*m_pbGetFlow;
    QHBoxLayout *hblFlow;

    // 流速百分比
    QLabel *m_lbFlowPercent;
    QLineEdit *m_leFlowPercent;
    QPushButton	*m_pbSetFlowPercent;
    QPushButton	*m_pbGetFlowPercent;
    QHBoxLayout *hblFlowPercent;

    // 最小压力
    QLabel *m_lbPressureMin;
    QLineEdit *m_lePressureMin;
    QPushButton	*m_pbSetPressureMin;
    QPushButton	*m_pbGetPressureMin;
    QHBoxLayout *hblPressureMin;

    // 最大压力
    QLabel *m_lbPressureMax;
    QLineEdit *m_lePressureMax;
    QPushButton	*m_pbSetPressureMax;
    QPushButton	*m_pbGetPressureMax;
    QHBoxLayout *hblPressureMax;

    // 预警压力
    QLabel *m_lbPressureWarning;
    QLineEdit *m_lePressureWarning;
    QPushButton	*m_pbSetPressureWarning;
    QPushButton	*m_pbGetPressureWarning;
    QHBoxLayout *hblPressureWarning;

    // 启动/停止
    QLabel *m_lbStartStop;
    QLineEdit *m_leStartStop;
    QPushButton	*m_pbSetStartStop;
    QPushButton	*m_pbGetStartStop;
    QHBoxLayout *hblStartStop;

    // 暂停/恢复
    QLabel *m_lbPauseRestore;
    QLineEdit *m_lePauseRestore;
    QPushButton	*m_pbSetPauseRestore;
    QPushButton	*m_pbGetPauseRestore;
    QHBoxLayout *hblPauseRestore;

    // 清洗
    QLabel *m_lbPurge;
    QLineEdit *m_lePurge;
    QPushButton	*m_pbSetPurge;
    QPushButton	*m_pbGetPurge;
    QHBoxLayout *hblPurge;

    // 清洗流速
    QLabel *m_lbPurgeFlow;
    QLineEdit *m_lePurgeFlow;
    QPushButton	*m_pbSetPurgeFlow;
    QPushButton	*m_pbGetPurgeFlow;
    QHBoxLayout *hblPurgeFlow;

    // 清洗时间
    QLabel *m_lbPurgeTime;
    QLineEdit *m_lePurgeTime;
    QPushButton	*m_pbSetPurgeTime;
    QPushButton	*m_pbGetPurgeTime;
    QHBoxLayout *hblPurgeTime;

    // 压力归零
    QLabel *m_lbPressureClear;
    QLineEdit *m_lePressureClear;
    QPushButton	*m_pbSetPressureClear;
    QPushButton	*m_pbGetPressureClear;
    QHBoxLayout *hblPressureClear;

    // 压力上传频率
    QLabel *m_lbPressureUploadFreq;
    QLineEdit *m_lePressureUploadFreq;
    QPushButton	*m_pbSetPressureUploadFreq;
    QPushButton	*m_pbGetPressureUploadFreq;
    QHBoxLayout *hblPressureUploadFreq;

    // 压力补偿
    QLabel *m_lbPressureCompen;
    QLineEdit *m_lePressureCompen;
    QPushButton	*m_pbSetPressureCompen;
    QPushButton	*m_pbGetPressureCompen;
    QHBoxLayout *hblPressureCompen;

    // 泵模式
    QLabel *m_lbMode;
    QLineEdit *m_leMode;
    QPushButton	*m_pbSetMode;
    QPushButton	*m_pbGetMode;
    QHBoxLayout *hblMode;

    // 压力
    QLabel *m_lbPressure;
    QLineEdit *m_lePressure;
    QPushButton	*m_pbSetPressure;
    QPushButton	*m_pbGetPressure;
    QHBoxLayout *hblPressure;

    // 运行模式
    QLabel *m_lbRunMode;
    QLineEdit *m_leRunMode;
    QPushButton	*m_pbSetRunMode;
    QPushButton	*m_pbGetRunMode;
    QHBoxLayout *hblRunMode;

    // 恒压泵专用
    // 最大流速
    QLabel *m_lbCP_FlowMax;
    QLineEdit *m_leCP_FlowMax;
    QPushButton	*m_pbSetCP_FlowMax;
    QPushButton	*m_pbGetCP_FlowMax;
    QHBoxLayout *hblCP_FlowMax;

    // 最小流速
    QLabel *m_lbCP_FlowMin;
    QLineEdit *m_leCP_FlowMin;
    QPushButton	*m_pbSetCP_FlowMin;
    QPushButton	*m_pbGetCP_FlowMin;
    QHBoxLayout *hblCP_FlowMin;

    // 压力阈值
    QLabel *m_lbCP_PressThreshold;
    QLineEdit *m_leCP_PressThreshold;
    QPushButton	*m_pbSetCP_PressThreshold;
    QPushButton	*m_pbGetCP_PressThreshold;
    QHBoxLayout *hblCP_PressThreshold;

    // 目标压力
    QLabel *m_lbCP_Press;
    QLineEdit *m_leCP_Press;
    QPushButton	*m_pbSetCP_Press;
    QPushButton	*m_pbGetCP_Press;
    QHBoxLayout *hblCP_Press;

    // PID参数
    QLabel *m_lbCP_PID;
    QLineEdit *m_leCP_PID_P;
    QLineEdit *m_leCP_PID_I;
    QLineEdit *m_leCP_PID_D;
    QPushButton	*m_pbSetCP_PID;
    QPushButton	*m_pbGetCP_PID;
    QHBoxLayout *hblCP_PID;

    // 当前压力和pid输出
    QLabel *m_lbCP_PressPidOut;
    QLineEdit *m_leCP_CurrentPress;
    QLineEdit *m_leCP_PidOut;
    QPushButton	*m_pbSetCP_PressPidOut;
    QPushButton	*m_pbGetCP_PressPidOut;
    QHBoxLayout *hblCP_PressPidOut;

    // 当前压力和pid输出的上传频率
    QLabel *m_lbCP_PressPidOutUploadFreq;
    QLineEdit *m_leCP_PressPidOutUploadFreq;
    QPushButton	*m_pbSetCP_PressPidOutUploadFreq;
    QPushButton	*m_pbGetCP_PressPidOutUploadFreq;
    QHBoxLayout *hblCP_PressPidOutUploadFreq;
};

#endif // HPLCPUMPBASICCONTROLPAGE_H
